<div class="layui-header">
    <!-- 头部区域 -->
    <ul class="layui-nav layui-layout-left">
        <li class="layui-nav-item layadmin-flexible" lay-unselect>
            <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
            </a>
        </li>
        <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="{$web_url}" target="_blank" title="前台">
                <i class="layui-icon layui-icon-website"></i>
                前台
            </a>
        </li>
        <li class="layui-nav-item" lay-unselect>
            <a href="javascript:void(0)" rel="external nofollow" onclick="qcclear(this)" data-GetUrl="{:url('Index/clear')}">
                <i class="layui-icon layui-icon-refresh-3"></i>
                清楚缓存
            </a>
        </li>
    </ul>
    <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
        <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="theme">
                <i class="layui-icon layui-icon-theme"></i>
                配色板
            </a>
        </li>

        <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;">
                <cite>{:session('admin.nickname') ? session('admin.nickname') : session('admin.username')}</cite>
            </a>
            <dl class="layui-nav-child">
                <dd><a lay-href="{:url('admin/edit',['admin_id'=>session('admin.id')])}">基本资料</a></dd>
                <hr>
                <dd  style="text-align: center;"><a href="{:url('Index/logout')}">退出</a></dd>
            </dl>
        </li>

    </ul>
</div>

<script>
    function qcclear(obj) {
        var url=obj.getAttribute('data-GetUrl');
        //询问框
        layer.confirm('您确定要清除吗？', {
                btn: ['确定','取消'] //按钮
            },
            function(){
                $.get(url,function(result){
                    console.log(result);
                    layer.msg(result.msg);
                });
            },
            function(){});
    }
</script>